From e04e507659027a5bb6fed24871539cc6ce56b96f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 5 Sep 2014 09:56:21 -0700 Subject: [PATCH] texture-cache: Use LTR/RTL icon lookup flags --- js/ui/viewSelector.js | 8 ++------ src/st/st-texture-cache.c | 10 +++++++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 88ef32ce6..e97627d19 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -144,12 +144,8 @@ const ViewSelector = new Lang.Class({ this._entry.set_primary_icon(new St.Icon({ style_class: 'search-entry-icon', icon_name: 'edit-find-symbolic' })); - if (this._entry.get_text_direction() == Clutter.TextDirection.RTL) - this._clearIcon = new St.Icon({ style_class: 'search-entry-icon', - icon_name: 'edit-clear-symbolic-rtl' }); - else - this._clearIcon = new St.Icon({ style_class: 'search-entry-icon', - icon_name: 'edit-clear-symbolic-ltr' }); + this._clearIcon = new St.Icon({ style_class: 'search-entry-icon', + icon_name: 'edit-clear-symbolic' }); this._iconClickedId = 0; this._capturedEventId = 0; diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index b99c0f86b..c507c4b3a 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -893,11 +893,19 @@ load_gicon_with_colors (StTextureCache *cache, GtkIconTheme *theme; GtkIconInfo *info; StTextureCachePolicy policy; + GtkIconLookupFlags lookup_flags; /* Do theme lookups in the main thread to avoid thread-unsafety */ theme = cache->priv->icon_theme; - info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, icon, size, scale, GTK_ICON_LOOKUP_USE_BUILTIN); + lookup_flags = GTK_ICON_LOOKUP_USE_BUILTIN; + + if (clutter_get_default_text_direction () == CLUTTER_TEXT_DIRECTION_RTL) + lookup_flags |= GTK_ICON_LOOKUP_DIR_RTL; + else + lookup_flags |= GTK_ICON_LOOKUP_DIR_LTR; + + info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, icon, size, scale, lookup_flags); if (info == NULL) return NULL; -- 2.39.5